package com.xiweicheng.test.springboot.hibernate.jpa.entity;
// Generated 2018-7-13 20:57:41 by Hibernate Tools 5.0.6.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;

/**
 * Channel generated by hbm2java
 */
@Entity
@Table(name = "channel", catalog = "tms", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
public class Channel implements java.io.Serializable {

	private Long id;
	private long version;
	private Users usersByOwner;
	private Users usersByCreator;
	private Users usersByUpdater;
	private Date createDate;
	private String description;
	private String name;
	private Boolean privated;
	private String status;
	private String title;
	private String type;
	private Date updateDate;
	private Set chatPins = new HashSet(0);
	private Set userses = new HashSet(0);
	private Set channelGroups = new HashSet(0);
	private Set spaceAuthorities = new HashSet(0);
	private Set chatChannels = new HashSet(0);
	private Set userses_1 = new HashSet(0);
	private Set blogAuthorities = new HashSet(0);
	private Set schedules = new HashSet(0);

	public Channel() {
	}

	public Channel(String name, String status) {
		this.name = name;
		this.status = status;
	}

	public Channel(Users usersByOwner, Users usersByCreator, Users usersByUpdater, Date createDate, String description,
			String name, Boolean privated, String status, String title, String type, Date updateDate, Set chatPins,
			Set userses, Set channelGroups, Set spaceAuthorities, Set chatChannels, Set userses_1, Set blogAuthorities,
			Set schedules) {
		this.usersByOwner = usersByOwner;
		this.usersByCreator = usersByCreator;
		this.usersByUpdater = usersByUpdater;
		this.createDate = createDate;
		this.description = description;
		this.name = name;
		this.privated = privated;
		this.status = status;
		this.title = title;
		this.type = type;
		this.updateDate = updateDate;
		this.chatPins = chatPins;
		this.userses = userses;
		this.channelGroups = channelGroups;
		this.spaceAuthorities = spaceAuthorities;
		this.chatChannels = chatChannels;
		this.userses_1 = userses_1;
		this.blogAuthorities = blogAuthorities;
		this.schedules = schedules;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public long getVersion() {
		return this.version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "owner")
	public Users getUsersByOwner() {
		return this.usersByOwner;
	}

	public void setUsersByOwner(Users usersByOwner) {
		this.usersByOwner = usersByOwner;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "creator")
	public Users getUsersByCreator() {
		return this.usersByCreator;
	}

	public void setUsersByCreator(Users usersByCreator) {
		this.usersByCreator = usersByCreator;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "updater")
	public Users getUsersByUpdater() {
		return this.usersByUpdater;
	}

	public void setUsersByUpdater(Users usersByUpdater) {
		this.usersByUpdater = usersByUpdater;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "description", length = 2000)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "name", unique = true, nullable = false)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "privated")
	public Boolean getPrivated() {
		return this.privated;
	}

	public void setPrivated(Boolean privated) {
		this.privated = privated;
	}

	@Column(name = "status", nullable = false)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "title")
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "type")
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_date", length = 19)
	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "channel")
	public Set getChatPins() {
		return this.chatPins;
	}

	public void setChatPins(Set chatPins) {
		this.chatPins = chatPins;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "member_channel", catalog = "tms", joinColumns = {
			@JoinColumn(name = "channel_id", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "user_id", nullable = false, updatable = false) })
	public Set getUserses() {
		return this.userses;
	}

	public void setUserses(Set userses) {
		this.userses = userses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "channel")
	public Set getChannelGroups() {
		return this.channelGroups;
	}

	public void setChannelGroups(Set channelGroups) {
		this.channelGroups = channelGroups;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "channel")
	public Set getSpaceAuthorities() {
		return this.spaceAuthorities;
	}

	public void setSpaceAuthorities(Set spaceAuthorities) {
		this.spaceAuthorities = spaceAuthorities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "channel")
	public Set getChatChannels() {
		return this.chatChannels;
	}

	public void setChatChannels(Set chatChannels) {
		this.chatChannels = chatChannels;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "subscriber_channel", catalog = "tms", joinColumns = {
			@JoinColumn(name = "channel_id", nullable = false, updatable = false) }, inverseJoinColumns = {
					@JoinColumn(name = "user_id", nullable = false, updatable = false) })
	public Set getUserses_1() {
		return this.userses_1;
	}

	public void setUserses_1(Set userses_1) {
		this.userses_1 = userses_1;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "channel")
	public Set getBlogAuthorities() {
		return this.blogAuthorities;
	}

	public void setBlogAuthorities(Set blogAuthorities) {
		this.blogAuthorities = blogAuthorities;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "channel")
	public Set getSchedules() {
		return this.schedules;
	}

	public void setSchedules(Set schedules) {
		this.schedules = schedules;
	}

}
